package com.atguigu.gmall.user.controller;

import com.atguigu.gmall.model.user.UserAddress;
import com.atguigu.gmall.user.service.UserAddressService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Fxz
 * @version 1.0
 * @date 2022-02-19 15:53
 */
@SuppressWarnings("all")
@RequestMapping("/api/user")
@RequiredArgsConstructor
@RestController
public class UserApiController {

	private final UserAddressService userAddressService;

	/**
	 * 跟据用户id查询收货列表
	 */
	@GetMapping("/inner/findUserAddressListByUserId/{userId}")
	public List<UserAddress> findUserAddressListByUserId(@PathVariable("userId") Long userId) {
		return userAddressService.findUserAddressListByUserId(userId);
	}

}
